<!--
 * @Author: Chuckie
 * @Email: chuckie@slanwell.com
 * @Date: 2023-06-06 10:57:23
 * @LastEditTime: 2023-06-08 13:39:03
 * @Description: 
 * @FilePath: /base-web/src/views/lowcode/preview.vue
 *  
-->
<template>
  <div class="app-container scroll-y">
    <v-form-render ref="preForm" :form-json="formJson" :preview-state="true"></v-form-render>

    <!-- <VFormRender
      ref="preForm"
      :form-json="formJson"
      :form-data="testFormData"
      :preview-state="true"
      :option-data="testOptionData"
      @myEmitTest="onMyEmitTest"
      @appendButtonClick="testOnAppendButtonClick"
      @buttonClick="testOnButtonClick"
      @formChange="handleFormChange"
    ></VFormRender> -->
  </div>
</template>

<script setup lang="ts">
let formJson = reactive({ widgetList: {}, formConfig: {} })

const route = useRoute()

onMounted(() => {
  if (route.params.code) {
    axiosReq({
      url: `/base/page/config/info/${route.params.code}`,
      method: 'get'
    }).then((res) => {
      console.log(JSON.parse(res.data.config), 92348)
      formJson.formConfig = JSON.parse(res.data.config).formConfig
      formJson.widgetList = JSON.parse(res.data.config).widgetList
    })
  }
})
</script>

<style lang="scss"></style>
